import { get } from 'lodash-es'
import { AppParameterName } from '../app-parameter-name/types'

export class AppParameterValue {
  id?: string
  hotel_id?: string
  app_parameter_name_id?: string
  app_parameter_value?: string
  created_id?: string
  updated_id?: string
  created_at?: string
  updated_at?: string
  version?: number
  app_parameter_name?: AppParameterName;
  [key: string]: any

  constructor(data?: AppParameterValue) {
    this.init(data)
  }
}

AppParameterValue.prototype.init = function init(data?: AppParameterValue) {
  this.id = get(data, 'id')
  this.hotel_id = get(data, 'hotel_id')
  this.app_parameter_name_id = get(data, 'app_parameter_name_id')
  this.app_parameter_value = get(data, 'app_parameter_value', '')
  this.created_id = get(data, 'created_id')
  this.updated_id = get(data, 'updated_id')
  this.created_at = get(data, 'created_at')
  this.updated_at = get(data, 'updated_id')
  this.version = get(data, 'version')
  this.app_parameter_name = get(data, 'app_parameter_name')
}
